﻿using UnityEngine;
using System.Collections;
using System;
using System.Collections.Generic;

namespace MaJiang{
	public class SortCard:IComparer<Card>{
		int IComparer<Card>.Compare(Card first,Card second){
			return first.id.CompareTo (second.id);
		}

	}
	public class MaJiangTool{
		public static SortCard sortCard = new SortCard();
		/// <summary>
		/// 检查花牌
		/// </summary>
		/// <returns><c>true</c>, if hua card was checked, <c>false</c> otherwise.</returns>
		/// <param name="player">Player.</param>
		public static void getPlayersCardsName(ref string _log,CardManager cardMgr){
			for (var i = 0; i < cardMgr.players.Length; i++) {
				getPlayerCardsName (ref _log, i,cardMgr.players [i]);
			}
		}
		public static void getPlayerCardsName(ref string _log,int index,PlayerCards player){
			_log += player.indexName+"牌面:";
			var cards = player.cards;
			for (var c = 0; c < cards.Count; c++) {
				_log += cards [c].CardName;
			}
			cards = player.huaCards;
			_log += "花牌:";
			for (var c = 0; c < cards.Count; c++) {
				_log += cards [c].CardName;
			}
			_log += "\n";
		}


	}
}
